Skip to content

Conversation

@Caball009
Copy link

@Caball009 Caball009 commented Aug 1, 2025

With this PR it'll become clear which clients are on a patched version with this feature and which are not:

  • the patched clients inform all other clients in the lobby and pre-match of their patch version.
  • the retail clients ignore the patch version data.
  • the patched clients show the player names of patched clients in a different color.
  • the patched clients show the player status of patched clients with a [SH] tag.

LAN Lobby:
image

Pre-match / Game Options:
image

Status in match:
image

TODO:

  • Add code comments.
  • Replicate in Generals.

@Caball009 Caball009 added Enhancement Is new feature or request GUI For graphical user interface Network Anything related to network, servers Gen Relates to Generals ZH Relates to Zero Hour labels Aug 1, 2025
@Caball009 Caball009 marked this pull request as ready for review August 10, 2025 19:34
@Caball009 Caball009 requested a review from a team August 11, 2025 15:24
Copy link

@xezon xezon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good effort.

This work relates to #16

I think the packets need redesigning.

@L3-M
Copy link

L3-M commented Oct 23, 2025

What is the current status of this change? I think this would be a nice change for the first release.

@L3-M L3-M added this to the Important features milestone Oct 23, 2025
@Caball009
Copy link
Author

Caball009 commented Nov 1, 2025

What is the current status of this change? I think this would be a nice change for the first release.

The current implementation ought to be changed to make it more efficient / optimal, but that requires much more work. I did some of the work locally, but it didn't really work out iirc, so the PR is kind of stuck for now.

@Caball009 Caball009 force-pushed the show_clients_with_sh_patch branch from 9fb6a01 to c4e3f1d Compare November 6, 2025 13:52
@Caball009
Copy link
Author

I've revisited this PR and was able to move away from the broadcast implementation. It feels better now. I put networking related changes in one commit and the color / status stuff in another.

What sort of information do we want to exchange just to establish which clients are on a patched version? Maybe it's a good idea to send the commit hash as well.

@Caball009 Caball009 requested a review from a team November 6, 2025 14:04
@Caball009
Copy link
Author

Caball009 commented Nov 6, 2025

Short overview of the new implementation. Patch information is not broadcast and only sent when needed.

Interacting with players in the lobby:

  1. When a player detects a new player in the lobby, they send a patch information request to that player.
  2. If the other player responds with an acknowledgement, they are on a 'patched version'.

Interacting with game hosts in the lobby:

  1. When a player in the lobby detects a new game host, they send a patch information request to that host.
  2. If the game host responds with an acknowledgement, they are on a 'patched version'.

Interacting with players in the pre-match game:

  1. When a player joins a match, they send all players in that match a patch information request.
  2. If the other players respond with an acknowledgement, they are on a 'patched version'.
  3. The other players consider the patch information request from the joining player as acknowledgement.

Currently, players in the lobby do not have a way to know which players in a match are on a 'patched version' except the host. It doesn't seem necessary to me to have the host communicate this information, and it also breaks the current pattern where each client only sends data about itself.

Copy link

@xezon xezon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is going into the right direction but needs more polishing and wider scope.

Are the pictures of the first post still relevant?

The terminology of the network data needs changing from "Patch" to "Product", because "Patch" is a much more limited term than "Product" is.

The ProductInfo message needs to contain all relevant information to describe the Product that the remote player is using. A version number alone will not be enough to properly describe a Product. Think of 100 different products that the user could interact with in the lobby.


void handlePatchInfo(Int messageType, UnsignedInt senderIP, UnicodeString gameName);
void handleGameRequestPatchInfo(LANMessage *msg, UnsignedInt senderIP);
void handleGameAcknowledgePatchInfo(LANMessage *msg, UnsignedInt senderIP);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is "Acknowledge" synonymous for replying to the request message? Perhaps call it "Response". And add it to the end of the name.

handleGamePatchInfoRequest
handleGamePatchInfoResponse

Even when that breaks the current EA naming pattern, it is a better naming pattern in my opinion.

This comment was marked as outdated.

Copy link
Author

@Caball009 Caball009 Nov 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is "Acknowledge" synonymous for replying to the request message? Perhaps call it "Response".

Yes, 'Acknowledge' is a response to a patch info request.

Should the enum still contain 'ACKNOWLEDGE'? (e.g. MSG_GAME_ACKNOWLEDGE_PATCH_INFO)
There's also a bunch of comments where I'm currently using the term 'acknowledge'.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I asked Chat what ACK refers to in Networking:

🧩 Definition

In networking, to acknowledge means:

To confirm receipt of data — that a packet, frame, or message has successfully arrived.

So when one device sends data to another, the receiver acknowledges it by sending back a message (an acknowledgment, or ACK) saying essentially:

“I got it — you can send the next one.”

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use ACK terminology only to confirm the receipt of a message, not for a response to a request. When the message is a request and in need of a response, then use the term "Response" for the response.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have moved away from 'acknowledge' now, except for in a few of the comments.

struct
{
WideChar gameName[g_lanGameNameLength + 1];
UnsignedInt patchVersion;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Product Name and Author Name are missing. Probably also needs to send EXE and INI hash, because Product Name and Version are not necessarily unique and hashes need to be part of identifying product.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I added all of these, but I'm not yet storing any of the data per player slot.

Renamed 'patch' to 'product' and added more information to the product information that's exchanged between clients.
@Caball009
Copy link
Author

Caball009 commented Nov 8, 2025

Are the pictures of the first post still relevant?

Yes, the colors are still like that; the status text will be slightly different. My current idea is that it shows the Git short hash string there (there isn't much room for additional text, unfortunately).

The terminology of the network data needs changing from "Patch" to "Product", because "Patch" is a much more limited term than "Product" is.

Fair enough. Everything should say 'product' instead of 'patch' now.

The ProductInfo message needs to contain all relevant information to describe the Product that the remote player is using. A version number alone will not be enough to properly describe a Product. Think of 100 different products that the user could interact with in the lobby.

I added a couple of stuff (e.g. exe and ini crc values), but I don't feel like this is final version yet.

UnsignedInt productVersion;
Char gitTagOrHash[33];
WideChar productName[129];
} ProductInfo;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This struct is kind of work-in-progress for now, but eventually any string sizes should be named like in the other structs.

@Caball009 Caball009 changed the title feat(gui): Distinguish patch players from retail players by a colored name and different status feat(network): Send product information to distinguish clients (with a colored name and different status) Nov 8, 2025

void LANAPI::setProductInfoFromMessage(LANMessage *msg, GameSlot *slot)
{
GameSlot::ProductInfo productInfo;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth adding a constructor for GameSlot::ProductInfo? And if so, should it take all these fields as separate function parameters?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it is constructed in a few places only then POD should be fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement Is new feature or request Gen Relates to Generals GUI For graphical user interface Network Anything related to network, servers ZH Relates to Zero Hour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants